import json
from deal_data import deal_with_data


table_data_list = []

with open("../../data/train_data.json", 'r', encoding='utf-8') as f:
    for line in f.readlines():
        line = json.loads(line)
        line['question'] = deal_with_data(line.get("question"))
        table_data_list.append(line)

with open("../../data/train_deal_data.json", 'w', encoding='utf-8') as f:
    for line in table_data_list:
        f.write(json.dumps(line, ensure_ascii=False) + '\n')
